<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>pkm</title>
  <link rel="stylesheet" href="./layui/css/layui.css">
</head>
<style>
  /* 自动换行css（标签列换行） */
  .layui-table-cell {
      height: auto;
      overflow: visible;
      text-overflow: inherit;
      white-space: normal;
      word-break: break-all;
  }
  #neko {
      width: 100px;
      height: 100px;
      background: #ddd;
      position: fixed;
      cursor: move;
      box-sizing: border-box;
      border: 4px solid #66cc66;
      border-radius: 50%;
      background: url('tp.png') no-repeat center center;
      background-size: 100% 100%;
      overflow: hidden;
      /* z-index: 2147483647; */
  }
</style>
<script src="./layui/layui.js"></script>
<script src="./index.js"></script> 
<!-- jstree相关内容 -->
<script src="./modules/jquery-3.5.1.min.js"></script> 
<script src="./modules/jstree.js"></script> 
<link rel="stylesheet" href="./modules/jstree.css">
<body bgcolor="#d9d2c2">

<div class="layui-fluid" style="padding-top: 10px;">
  <div class="layui-row layui-col-space10">
    <div class="layui-col-md3">
      <div class="layui-card" style="height: calc(100vh - 67px)">
        <div class="layui-card-body">
          <div class="layui-row">
            <div class="layui-col-md12 layui-form-item">
              <div class="layui-btn-group">
                <button type="button" title="保存" class="layui-btn layui-btn-sm" id="saveTree">
                  <i class="layui-icon">&#xe605;</i>
                  <span class="layui-badge-dot layui-bg-orange" style="display: none"></span>
                </button>
                <button type="button" title="刷新" class="layui-btn layui-btn-sm" id="refreshTree">
                  <i class="layui-icon">&#xe669;</i>
                </button>
                <!-- <button type="button" title="历史版本" class="layui-btn layui-btn-sm" id="historyTree">
                  <i class="layui-icon">&#xe68d;</i>
                </button> -->
              </div>
            </div>
            <div class="layui-col-md12 layui-form-item">
              <div id="slideTest"></div>
            </div>
            <div class="layui-col-md12 layui-form-item">
              <input id="tree-search" type="text" name="search" placeholder="请输入标签" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-col-md12 layui-form-item" style="height: calc(100vh - 210px);overflow: scroll;">
              <div id="jstree_demo_div"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="layui-col-md9">
      <div class="layui-card">
        <div class="layui-card-body">
          <div class="layui-row">
            <div class="layui-col-md12">
              <form class="layui-form" lay-filter="search" action="">
                <div class="layui-form-item">
                  <div class="layui-row">
                    <div class="layui-col-md11">
                      <input type="text" name="search" placeholder="标签 文件名正则表达式" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-col-md1">
                      <button class="layui-btn" lay-submit lay-filter="search" id="search" style="width: 100%;"><i class="layui-icon layui-icon-search"></i> 搜索</button>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </div>
          <div class="layui-row">
            <div class="layui-col-md12">
              <table id="demo" lay-filter="test"></table>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="layui-col-md12">
      <button id="cmdBtn" type="button" class="layui-btn layui-btn-primary layui-btn-fluid">cmd</button>
    </div>
  </div>
</div>

<!-- 编辑弹出层 -->
<div id="edit" style="display: none;">
  <div class="layui-fluid" style="padding-top: 10px;">
    <form class="layui-form" lay-filter="edit" action="">
      <input type="text" name="id" required lay-verify="required" autocomplete="off" class="layui-input" style="display: none;"> 
      <div class="layui-form-item" pane>
        <label class="layui-form-label">文件名称</label>
        <div class="layui-input-block">
          <input type="text" name="filename" required lay-verify="required" autocomplete="off" class="layui-input"> 
        </div>
      </div>
      <div class="layui-form-item" pane>
        <label class="layui-form-label">标签</label>
        <div class="layui-input-block">
          <!-- 标签动态渲染 -->
          <div id="tagContainer">
          </div>
        </div>
      </div>

      <div class="layui-form-item">
        <!-- type=button 避免回车提交数据 -->
        <div class="layui-input-block">
          <button type="button" class="layui-btn" lay-submit lay-filter="edit">提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

<!-- 行操作按钮模板 -->
<script type="text/html" id="colTool">
  <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open">打开</a>
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<!-- 行标签（徽章）渲染模板 -->
<script type="text/html" id="tagList">
  {{#  layui.each(d.tags, function(index, tag){ }}
  <span class="layui-badge-rim">{{tag}}</span>
  {{#  }); }}
</script>

<!-- 标签渲染 -->
<script type="text/html" id="editTagList">
  <div class="layui-btn-container tag" lay-filter="tags" lay-allowclose="true" lay-newTag="true">
    {{#  layui.each(d.tags, function(index, tag){ }}
    <button lay-id="{{index}}" type="button" class="tag-item">{{tag}}</button>
    {{#  }); }}
  </div>
</script>

<!-- 添加数据弹出层 -->
<div id="add" style="display: none;">
  <div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
      <li class="layui-this">创建文件</li>
      <li>url</li>
      <li>文件复制</li>
    </ul>
    <div class="layui-tab-content">
      <div class="layui-tab-item layui-show">
        <form class="layui-form" lay-filter="addFile" action="" id="addFile">
          <div class="layui-form-item">
            <label class="layui-form-label">文件名</label>
            <div class="layui-input-block">
              <input type="text" name="filename" required  lay-verify="required" placeholder="请输入文件名" autocomplete="off" class="layui-input">
            </div>
          </div>
          <!-- 标签动态渲染 -->
          <div class="layui-form-item">
            <label class="layui-form-label">标签</label>
            <div class="layui-input-block">
              <div class="layui-btn-container tag" lay-filter="addFileTags" lay-allowclose="true" lay-newTag="true">
            </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <!-- type=button 避免回车提交数据 -->
              <button type="button" class="layui-btn" lay-submit lay-filter="addFile">提交</button>
            </div>
          </div>
        </form>
      </div>
      <div class="layui-tab-item">
        <form class="layui-form" lay-filter="addUrl" action="" id="addUrl">
          <div class="layui-form-item">
            <label class="layui-form-label">url</label>
            <div class="layui-input-block">
              <input type="text" name="url" required  lay-verify="required" placeholder="url" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
              <input type="text" name="filename" required  lay-verify="required" placeholder="文件名" autocomplete="off" class="layui-input">
            </div>
          </div>
          <!-- 标签动态渲染 -->
          <div class="layui-form-item">
            <label class="layui-form-label">标签</label>
            <div class="layui-input-block">
              <div class="layui-btn-container tag" lay-filter="addUrlTags" lay-allowclose="true" lay-newTag="true">
            </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <!-- type=button 避免回车提交数据 -->
              <button type="button" class="layui-btn" lay-submit lay-filter="addUrl">提交</button>
            </div>
          </div>
        </form>
      </div>
      <div class="layui-tab-item">
        <form class="layui-form" lay-filter="copyFile" action="" id="copyFile">
          <div class="layui-form-item">
            <label class="layui-form-label">文件路径</label>
            <div class="layui-input-block">
              <input type="text" name="path" required  lay-verify="required" placeholder="文件路径" autocomplete="off" class="layui-input">
            </div>
          </div>
          <!-- 标签动态渲染 -->
          <div class="layui-form-item">
            <label class="layui-form-label">标签</label>
            <div class="layui-input-block">
              <div class="layui-btn-container tag" lay-filter="copyFileTags" lay-allowclose="true" lay-newTag="true">
            </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <!-- type=button 避免回车提交数据 -->
              <button type="button" class="layui-btn" lay-submit lay-filter="copyFile">提交</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<div id="cmdwin" style="display: none;">
  <div class="layui-fluid layui-form layui-form-pane" style="padding-top: 10px;">
    <div class="layui-form-item">
      <div class="layui-row">
        <div class="layui-col-md2">
          <select id="cmdInfoSelect" lay-verify="required" lay-filter="cmdSelect" lay-search>
          </select>
        </div>
        <div class="layui-col-md10">
          <input id="cmdInput" type="text" name="cmdStr" placeholder="cmd参数" class="layui-input">
        </div>
      </div>
    </div>
    <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">输出</label>
      <div class="layui-input-block">
        <textarea id="cmdResult" class="layui-textarea" disabled></textarea>
      </div>
    </div>
  </div>
</div>

<!-- 悬浮球div -->
<div id="neko">
</div>
</body>
</html>